﻿@{
    ViewBag.Title = "MemberMerge";
}

    <div id = "DivHeader">
        <table>
            <tr>
                <td width ="150px">
                    <a id="Merge" class="mini-button" iconcls="icon-downgrade" onclick="Merge" plain="true">合并到组</a>
                </td>
            </tr>
        </table>
    </div>
    <div class="mini-fit">
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" borderStyle="border:1;"pageSize="15"
            url="../Member/GetGroup" allowCellSelect="true" fitColumns="false" sortMode="client">
            <div property="columns">
                <div type="checkcolumn" ></div>
                <div type="indexcolumn" width="40" headerAlign="center" >序号</div>
                <div field="FName" width="150px"  headerAlign="center">会员共享组名称</div> 
            </div>
        </div>  
    </div>


<script>
    mini.parse();

    var grid = mini.get("datagrid1");
    $(function () {
        LoadList();
    });

    function LoadList() {
        var json = "[{'FSystemAppID':'" + parent.window.getSystemAppID() + "',";
        json = json + "'search':" + "''";
        json = json + "}]";
        grid.load({ mjson: json });
    }

    function Merge() {
        var row = grid.getSelected();
        if (row) {
            var json = '[{"mSystemAppID":"' + parent.window.getSystemAppID() + '",'
                + '"FGroupID":' + row["FGroupID"]
                + '}]';
            $.post("Merge", { json: json }, function (data) {
                if (ret.status == 1) {
                    mini.showTips({ content: ret.msg, state: "success", x: "center", y: "top", timeout: 3000 });
                }
                else {
                    mini.alert("" + ret.error);
                }
            });
        }
        else {
            mini.alert("请选择一行再合并");
        } 
    }
</script>